home *** CD-ROM | disk | FTP | other *** search
- /* file timestam.c */
-
- /*
- TimeStamp used to create log entries with the current date and time
- from a batch command file. Usually output is redirected to a disk file.
- I use it to log events on my BBS when special processing takes place.
-
- Echo the input command line args with a date & time stamp appended.
- */
-
- #include <stdio.h>
- #include <stdlib.h>
- #include <time.h>
- #include "strftime.h"
-
- main (int argc, char *argv[])
- {
- struct tm *now;
- time_t cnow;
- char ts[50];
-
- while (--argc)
- printf("%s ", *++argv);
- time(&cnow);
- now = localtime(&cnow);
- strftime(ts, 49, "%c", now);
- printf(" %s\n", ts);
- return 0;
- }
-